<%@page import="com.lzl.dao.Adminlogin"%>
<%@page import="com.lzl.dao.Adminloginimpl"%>
<%@page import="com.lzl.entity.Admin"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%
	//获取表单信息
	
	String uid=request.getParameter("username");
	String pwd=request.getParameter("password");
	session.setAttribute("username",uid);
	session.setAttribute("password",pwd);
	
	//验证账号密码
	
	Adminlogin loginuser=new Adminloginimpl();
	Admin user=new Admin();
	user.setUsername(uid);
	user.setPassword(pwd);
	boolean result=loginuser.login(user);
	if(result) {
		request.getRequestDispatcher("system.jsp").forward(request,response);
	} else {
		response.sendRedirect("error.jsp");
	}
%> 
</body>
</html>